CC=mingw32-g++.exe -Wall -g 


CFLAGS=$(shell pkg-config --cflags --libs gtk+-2.0)
CFLAGS+=-mwindows

LDFLAGS=$(shell pkg-config --libs gtk+-2.0)

INCLUDE=-I src/model

OUT=bin/couture.exe

MODEL_OBJECTS=Point Courbe Piece Couture Patron


all: compile link
	@echo ""
	@echo ""
	@echo "-------------------------"
	@echo "All done"


start_compile:
	@echo ""
	@echo "Compilation"
	@echo "-------------------------"

compile: start_compile $(MODEL_OBJECTS) main.o
	@echo " > Copie des ressources"
	@cp -r rsc/* bin
	@echo ""
	@echo "Compilation terminee"

$(MODEL_OBJECTS) :  
	@echo " > Compilation de $@"
	@$(CC) -c $(INCLUDE) $(CFLAGS) src/model/$@.cpp -o obj/$@.o  
	@echo "			Compilation de $@ OK"

main.o: 
	@echo " > Compilation de main"
	@$(CC) -c $(INCLUDE) $(CFLAGS) src/main.cpp -o obj/main.o
	@echo "			Compilation de main OK"


link:
	@echo ""
	@echo "Link"
	@echo "-------------------------"
	@echo " > link all .o"
	@$(CC) obj/*.o $(INCLUDE) $(LDFLAGS) -o $(OUT)


clean: 
	@echo ""
	@echo "Cleaning"
	@echo "-------------------------"
	@rm -f obj/*.o
	@rm -rf bin/*
